Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social: Prevent the editor extension loading for unsupported post types #24545

Merged
merged 2 commits into from
May 30, 2022

Conversation

pablinos
Copy link
Contributor

There's a bug #20357 that means if code is loaded that relies on the
@wordpress/editor or @wordpress/edit-post packages, then it crashes
the Site Editor.

Changes proposed in this Pull Request:

This change checks the post type being editted and whether it supports
Publicize. If it doesn't, we skip loading the JS code.

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  • Create a site with Jetpack Social installed and connected
  • Activate a block theme, such as Twenty Twenty Two
  • Load the Site Editor by going to Appearance -> Editor
  • Without this change you'll be presented with a blank screen
  • With this change, it will load correctly

There's a bug #20357 that means if code is loaded that relies on the
`@wordpress/editor` or `@wordpress/edit-post` packages, then it crashes
the Site Editor.

This change checks the post type being editted and whether it supports
Publicize. If it doesn't, we skip loading the JS code.
@pablinos pablinos requested a review from a team May 27, 2022 19:50
@pablinos pablinos self-assigned this May 27, 2022
@pablinos pablinos added [Status] Needs Team Review [Extension] Publicize Block editor plugin [Plugin] Social Issues about the Jetpack Social plugin labels May 27, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 27, 2022

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Social plugin:

  • Next scheduled release: June 7, 2022.
  • Scheduled code freeze: May 30, 2022.

Copy link
Contributor

@spsiddarthan spsiddarthan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this!

@pablinos pablinos enabled auto-merge (squash) May 30, 2022 07:37
@pablinos pablinos merged commit b0bf0cf into master May 30, 2022
@pablinos pablinos deleted the fix/social-site-editor branch May 30, 2022 07:39
@github-actions github-actions bot added this to the social/1.0.0 milestone May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Extension] Publicize Block editor plugin [Plugin] Social Issues about the Jetpack Social plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants